package l1j.server.server.model.damage.physical;

import l1j.server.server.model.L1Character;
import l1j.server.server.model.damage.L1Dmg;
import l1j.server.server.model.damage.hit.L1Hit;

public class PhysicalAttack {

	private L1Hit _hit;

	private L1Character _attacker;

	private L1Character _target;

	public PhysicalAttack(L1Character attacker, L1Character target) {
		_hit = L1Hit.get(attacker, target);
		_attacker = attacker;
		_target = target;
	}

	public boolean isHit(){
		return _hit.isHit();
	}
	
	public void action() {
		if (_hit.calcHit()) {
			L1Dmg dmg = L1Dmg.get(false, 0, _attacker, _target);
			dmg.calcDmg();
			dmg.hurtTarget(true);
		}
	}
}
